home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-1.iso
/
utility
/
horst_2.zip
/
LOGTRIM.DOC
< prev
next >
Wrap
Text File
|
1995-12-18
|
3KB
|
85 lines
------------------------------------------------------------------------
LOGTRIM trim logfiles Ver 1.4 (c) 1995 Horst Schaeffer
------------------------------------------------------------------------
LOGTRIM keeps the size of logfiles within a given range (kilobytes).
Files are always cut at the beginning of a line. The optional string
is used to identify the beginning of a log section for proper cutting.
Syntax: LOGTRIM logfile minKB maxKB ["string"]
--------------------------------------
Example: LOGTRIM fd.log 200 160 "--------"
---------- Parameters:
logfile: Name of file to trim (drive, path optional).
First character of filespec must not be "@" (see below).
File size not limited.
maxKB: There will be no action if the file size is not beyond maxKB.
If file size > maxKB, then:
minKB: the file will be reduced to minKB
(cut at beginning of next line)
The two values may be specified in any order.
If only one value is specified, this will refer to maxKB,
and minKB defaults to half the value of maxKB.
Comma separators allowed.
string: (optional, single or double quotes)
LOGTRIM will search for the first occurrence of this string
(from the break point determined by minKB) and cut at the
beginning of that line.
If the string cannot be found within the first 10%
of the remaining file, the string option is ignored.
Special feature: an empty string ("") will cause LOGTRIM
to look for an empty line.
output: LOGTRIM confirms the filename and indicates "trimmed"
if any action was taken.
note: No action if logfile is opened by other task (error msg).
In case of write or rename errors the temporary file LOG$$$$$.TMP may
remain in the current directory. Before deleting this file make sure
that the original log file still exists.
Errorlevel: 0 no action or successful completion
else: error (message)
---------- Reading parameters from a control file
For multiple logfile handling LOGTRIM can read the parameters from
a control file holding the command arguments for each file to trim
(line by line), e.g.:
C:\LOG 30 20 'on'
C:\FD\FD.LOG 200 160 "--------"
C:\FD\FDTRANX.LOG 10,6,"────"
A control file will be used by the following syntax:
LOGTRIM @ control_file
----------------------
Drive and path for control_file are optional. A space between @-sign and
filespec is not required. Examples:
LOGTRIM @loglist
LOGTRIM @ C:\util\logfiles.lst
In the control file any lines starting with a semicolon (;) and empty
lines are ignored. If an asterisk (*) is found at the beginning of a
line, the rest of the file will be ignored. The size is limited to 4 KB.
In case of read errors in one of the log files, LOGTRIM proceeds with
the next line in the control file, but LOGTRIM will abort on write/make/
rename errors to avoid loss of data.
= 02 APR 1995 - Horst Schaeffer, FIDO 2:2480/13.75
Internet: horst_schaeffer@confusion.muc.nacamar.de
= Thanks to Bat Lang for his contribution to the concept of LOGTRIM. =